package com.jian8.juc.thread;

import com.alibaba.ttl.TransmittableThreadLocal;

import java.sql.SQLOutput;

/** 线程间进行实现数据同步
 * @author wu
 * @create 2023-07-13-11:10
 */
public class ShareDataExample {

    public static void main(String[] args) {
        TransmittableThreadLocal<String> objectTransmittableThreadLocal = new TransmittableThreadLocal<>();
        objectTransmittableThreadLocal.set("1");
        MyThreadShareDataExample myThreadShareDataExample = new MyThreadShareDataExample();
        myThreadShareDataExample.start();

    }
}
 class MyThreadShareDataExample extends  Thread{
    @Override
    public void run(){

    }

}

class  Runable implements Runnable{

    @Override
    public void run() {
        System.out.println(1);

    }
}
